package com.innovatio.validator.handlers;


import org.apache.log4j.Logger;
import com.innovatio.validator.annotations.ValidateCreditCard;
import com.innovatio.validator.Validable;
import com.innovatio.validator.exceptions.ValidatorException;
import com.innovatio.validator.ValidationErrors;
import com.innovatio.utils.general.CommonsUtils;


/**
 * This code is property of Innovatio Software Solutions, Inc.
 * Project PaySmart
 * User: Ramon
 * Date: Mar 4, 2009
 * Time: 11:01:47 AM
 */
public class ValidateCreditCardHandler implements ValidationHandler<ValidateCreditCard> {


    private static Logger logger = Logger.getLogger(ValidateCreditCardHandler.class);

    


    public ValidationErrors.Error validate(ValidateCreditCard annotation, Validable container, String fieldName, String value) throws ValidatorException {

        if (!CommonsUtils.isStringEmpty(value)) {

//            String type = container.getFieldValue(annotation.cardTypeFieldName()).toString();
//            if (type != null && !type.isEmpty()) {
//                logger.trace("validating payment type --->"+type);
//                CardType type = CardType.
//                if (!CreditCardUtils.validateCreditCardNumber(p,value.toString()))
//                    return new ValidationError("Invalid Card Number", fieldName);
//
//            }
        }
        return null;

    }


   


}